Getting Some Data

First thing's first, I will import necessary libaries.

In light of me going to Seattle this summer for an internship (YAY!), I decided to use a dataset containing locations of public transit stops in King County Washington. I will then differentiate them by the times they stop servicing commuters. For example, stops serviced after 8:00pm, serviced after 10:00pm, so on and so forth.

The datasets and information links can be found HERE:

Since there is a lot of data we do not care about, I will remove all those columns to make things easier to follow and less crowded.

Now I will get the latest departure/arrival from the stop_times_df, for each stop (stop_id) in the stops_df, and insert that value into its own column for that stop as "latest_service_time"

Now we need to make sure that these all have coordinates as that is what we care about, and handle any missing ones if necessary. As for stop_ids, they are required according to documentation so there shouldn't be any missing ones, and if there are I will consider them invalid. I will also do the same for the latest_service_times values.

As indicated by the True output that was given, there are no null coordinates so no need to "handle" them.

Now I will get the latest arrival time for each stop (stop_id) and then add that to a new column for stops_df. This way we don't need to use the stop_times_df anymore, all of the info we need from that will be inserted into the stops_df.

Making a Map

Using Folium I will create a map that is focused around Seattle (King County) Washington where the data is centered around.

Combining Part 1 & 2

Here I will mark the public transit stops on the map. I will visually differentiate the stops such that stops that are serviced late (after 22:00 for example) will be a different color than stops only serviced earlier (before 22:00).